/*
 * @Description: 服务模块公共参数
 * @Autor: 何兴家
 * @Date: 2020-11-23 15:22:04
 * @LastEditors: 何兴家
 * @LastEditTime: 2021-03-03 17:23:17
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

/**
 * @description: 根据itemcode查询系统参数
 * @param { itemCode: String } params
 * @return {*}
 * @author: 何兴家
 */
export const getSystemDefault = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repair/querySystemDefaultInfo`, {
    params
  });

// 获取全部服务参数
export const findAllRepair = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales`, {
    params
  });

/**
 * @description: 查询车档列表
 * @param { license: String, vin: String, ownerName: String, mobile: String }
 * @return {*}
 * @author: 何兴家
 */
export const queryRepairVehicleList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repair/license`, {
    params,
    timeout: 60000
  });

// 查询当前经销商所有员工
export const getDealerUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);
/**
 * @description: 维修项目列表
 * @param {labourCode  项目代码 labourName  项目名称 itemStatus 启用状态 isUpgrade 是否技术升级 modelLabourCode 车型 oemTag 数据来源 seriesCode } params
 * @return {*}
 * @author: 何兴家
 */
export const getWxproductList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairProject/selectAllRepairItemDealer`, {
    params
  });

// 选择备件(库存中)
export const queryRepairInventoryPart = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partStocks/repairFindStock`, {
    params
  });

// 根据配件获取配件详细信息
export const queryPartDetailInfoByPartNo = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/allocation/queryStockInfo`, {
    params
  });

// 获取权限仓库列表
export const findUserControlStorageCode = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partStocks/findUserControlStorageCode`, {
    params
  });

/**
 * @description: 根据用户id串查询对应id用户信息
 * @param {String} userIds 以逗号分隔的用户id字符串
 * @return {Array} employeeName employeeId
 * @author: 何兴家
 */
export const getNameByIds = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getNameByIds`, { params });
// 查询当前经销商所有人
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);
// 查询所有品牌  - 销售提供的接口
export const getAllBrand = params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/vehicleProduct/queryBrandDictAll`);
// 查询所有车系 - 销售提供的接口
export const getAllSeries = params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/vehicleProduct/seriess/all`);
// 根据车型查询所有车型 - 销售提供的接口
export const getAllModel = params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/vehicleProduct/models/all`, { params });

// 根据vin获取剩余优惠包次数
export const getIssuePackagesNum = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/repair/group/getIssuePackagesNum`, { params });

// 根据vin获取客诉历史
export const getcomplainbillforvin = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/complaintBill/getcomplainbillforvin`, { params });
